<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>onMouseUp (Callback)</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->onMouseUp (Callback)<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>onMouseUp (hWnd, button, x, y) </p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>This callback is invoked when a mouse button is released. </p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hWnd<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the window that triggered the event <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->button<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->A constant that identifies the button that was released. See onMouseDown for a list of button constants. <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->x<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The x coordinate where the button was released. Relative to the upper left hand corner of the window <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->y<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The y coordinate where the button was released. Relative to the upper left hand corner of the window <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>0</p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>This is a callback function. You must supply this function yourself. To register this callback, call the <a href="WinXRegOnMouseMove.htm">WinXRegOnMouseUp</a> function.</p>
<p>It is possible for the user to press the mouse button over your window and release it elsewhere. In this case you the onMouseDown callback will be called, but not the onMouseUp callback. To make sure you get the onMouseUp callback, capture the mouse using the SetCapture and ReleaseCapture Win32 API functions.</p>
<p>In general, if an action occurs when the user clicks something, you should cause that action to occur when the onMouseUp callback is invoked, not the <a href="onMouseDown.htm">onMouseDown</a> callback. This gives the user a chance to cancel the action by moving the mouse away from your window and releasing it there. </p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" -->
      <p class="codeStyle">FUNCTION onMouseUp (hWnd, button, x, y)</p>
      <blockquote>
        <p class="codeStyle">'find our which button was pressed <br>
    SELECT CASE button</p>
        <blockquote>
          <p class="codeStyle">CASE $$MBT_LEFT: button$ = &quot;left&quot;<br>
      CASE $$MBT_MIDDLE: button$ = &quot;middle&quot;<br>
      CASE $$MBT_RIGHT: button$ = &quot;right&quot;</p>
        </blockquote>
        <p class="codeStyle">END SELECT</p>
        <p class="codeStyle">'assuming we have a console attached to this app,<br>
    'print the button and where it was clicked<br>
    PRINT &quot;You released the &quot;;button$;&quot; mouse button at &quot;;x;&quot;, &quot;;y</p>
      </blockquote>
      <p class="codeStyle"> END FUNCTION </p>
    <!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="WinXRegOnMouseMove.htm">WinXRegOnMouseUp</a><br>
<a href="onMouseDown.htm">onMouseDown (Callback) </a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
